package demo1;

public class Text {


    public static void main(String[] args) {
        Shape shape = new Pect();
        shape.draw();

        System.out.println("================");

        Shape shape1 = new Flower();

        if(shape1 instanceof Pect){
            Flower flower = (Flower)shape1;
            flower.fly();
        }else{
            System.out.println("shape instanceof Pect not!!!");
        }



    }

    public static void func(Shape shape){
        shape.draw();
    }

    public static Shape returnShape(Shape shape){
        return shape;
    }


    public static void main2(String[] args) {

        Triangle triangle = new Triangle();
        Flower flower = new Flower();
        Pect pect = new Pect();
        Cycle cycle = new Cycle();

        func(pect);
        func(flower);
        func(triangle);
        func(cycle);

//        Shape[] shapes = {triangle,flower,cycle,pect};
//
//        for (Shape shape : shapes){
//            shape.draw();
//        }


    }



    public static void main1(String[] args) {
        Shape shape = new Shape();
        //shape.draw();
    }
}
